package com.freewater.springboot.demo.aop.introduction;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        final AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
        applicationContext.registerShutdownHook();
        //
        final BusinessService businessService = applicationContext.getBean(BusinessService.class);
        businessService.doSomething();
        businessService.doSomething();
        businessService.doSomething();
        //
        OtherService otherService = applicationContext.getBean(OtherService.class);
        otherService.doOtherThing();
        otherService.doOtherThing();
        otherService.doOtherThing();
    }
}
